import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooConfigController } from '../../../controllers';
const uctooconfigRouter = new Router();
const configController = new uctooConfigController();

uctooconfigRouter.post('/add', requireUser, configController.add);
uctooconfigRouter.post('/edit', requireUser, rowLevelPermission('uctoo/config'), configController.edit);
uctooconfigRouter.post('/del', requireUser, rowLevelPermission('uctoo/config'), configController.delete);

//For getting config with permission control
uctooconfigRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/config'), configController.getSingle);
uctooconfigRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/config'), configController.getMany);
uctooconfigRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/config'), configController.getMany);

//#endregion AutoCreateCode
export default uctooconfigRouter;
